$(function () {
    let mychart = echarts.init(document.querySelector('.sixBox'))
    let option = {
        title: {
            show: true,
            text: "需求增幅",
            top: 10,

            left: 15,
            // padding: [10],
            textStyle: {
                fontWeight: "normal",
                color: "#fff", // 标题颜色
                fontSize: 14,

            },
        },
        legend: {
            data: ['金额', '数量', '完成率'],
            top: 10,
        },
        xAxis: {
            type: 'category',
            data: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', ]
        },
        grid: {
            top: 70,
            bottom: 30,
        },
        yAxis: [{
                name: '金额',
                type: 'value',
                axisLine: {
                    show: true, // 显示坐标轴线
                },
                splitLine: {
                    show: false
                }
            },
            {
                name: '完成率',
                type: 'value',

                min: 0,
                max: 100,
                axisLine: {
                    show: true, // 显示坐标轴线
                },
                splitLine: {
                    show: false
                }
            },
        ],
        series: [{
                name: '金额', //添加图例(legend数组中的name,要和series中的name相同)
                data: [150, 230, 224, 218, 135, 147, 123, 231, 224, 218, 242, 425, 231],
                type: 'bar',


            },
            {
                name: '数量',
                data: [134, 345, 60, 56, 75, 45, 78, 357, 123, 432, 30, 425, 231],
                type: 'bar',
                barGap: 0, //无缝隙，，所有前面的对象共享该属性设置
                itemStyle: { //渐变色配置
                    normal: {
                        color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: '#F5DF31'
                        }, {
                            offset: 1,
                            color: '#2F9EFA'
                        }]),
                    },
                }

            },
            {
                name: '完成率',
                data: [12, 92, 23, 87, 12, 56, 34, 12, 76, 45, 34, 73],
                type: 'line',
                smooth: true, //平滑的折线
                yAxisIndex: 1, //折线参考右侧的刻度

            }
        ],
    };
    mychart.setOption(option)
    mychart.setOption(option)
    window.addEventListener('resize',function(){
        mychart.resize()
    })
    
})